<%@ page import="java.util.Vector" %><%--
  Created by IntelliJ IDEA.
  User: drophair
  Team: 深藏blow
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎你,回来</title>
    <script src="/js/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <style>
        .goods {
            height: 50px;
            /*text-align: center;*/
            background-color: darksalmon;
        }

        .goods > a {
            /*padding: 80px;*/
            display: inline;
        }

        .goods-show {
            background-color: blanchedalmond;
            height: 650px;
        }

        .footer {
            text-align: center;
        }

        li {
            list-style: none; /* 将默认的列表符号去掉 */
            /*padding:0; !* 将默认的内边距去掉 *!*/
            /*margin:0; !* 将默认的外边距去掉 *!*/
            padding: 20px;
            display: inline-block;
        }
    </style>
</head>
<body background="/img/bg.jpg">
<h1>软件商店</h1>
<div style="display: inline-block">
    <jsp:include page="../userinfo.jsp"/>
</div>
<hr>
<div class="goods">
    <br>
    <span> </span>
    <a href="javascript:void(0);" onclick="showAll()">全部</a>
    <a href="javascript:void(0);" onclick="show1()">图书借阅工具</a>
    <a href="javascript:void(0);" onclick="show2()">杀毒软件</a>
    <a href="javascript:void(0);" onclick="show3()">聊天工具</a>
    <a href="javascript:void(0);" onclick="show4()">游戏</a>
    <a href="javascript:void(0);" onclick="show5()">浏览器</a>
    <a href="javascript:void(0);" onclick="show6()">播放器</a>
    <br>
</div>
<br>
<div class="goods-show">
    <ul id="all-goods">
        <%
            Vector<Vector<String>> vectors = new Vector<Vector<String>>();
            vectors = (Vector<Vector<String>>) request.getAttribute("goods");
            for (Vector vector : vectors) {
                String goodid = "", goodname = "", goodprice = "";
                goodid = (String) vector.get(0);
                goodname = (String) vector.get(1);
                goodprice = (String) vector.get(2);
//                String innerHtml = String.format("<a><img src=\"/img/li.png\" style=\"height:30%\"><a href=\"DetailServlet?goodid=%s\">%s</a>&nbsp;a href=\"AddCartServlet?%s\">加购</a></a>", goodid, goodname, goodprice);
        %>
        <li><a><img class="media-object img-circle img-thumbnail" style="height: 30%" src="/img/li.png"><br><%=goodname%><a
                href="DetailServlet?goodid=<%=goodid%>&goodname=<%=goodname%>&goodprice=<%=goodprice%>">详情</a><a
                href="AddCartServlet?goodid=<%=goodid%>&goodname=<%=goodname%>">加购</a></a></li>
        <%}%>
        <%--        <li><a><img src="/img/li.png"><%=goodname%><a href="DetailServlet?goodid=<%=goodid%>">购买</a><a href="AddCartServlet?goodid=<%=goodid%>">加购</a></a></li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>借书系统</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>杀毒软件</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>聊天工具</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>游戏</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>浏览器</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
        <%--        <li>--%>
        <%--            <a><img src="/img/li.png" style="height: 30%"><br><span>播放器</span>&nbsp;<a href="DetailServlet">购买</a>&nbsp;<a href="AddCartServlet">加购</a></a>--%>
        <%--        </li>--%>
    </ul>
</div>
<div class="footer">
    <br>
    <span>王少杰制作</span>
</div>
</body>
<script type="text/javascript">
    function showAll() {
        // alert("OK");
        // $("li").hide();
    }
</script>
</html>
